#include <iostream>
#define WIDTH 100
#define HEIGHT 100
class World{
    public:
        World():grassTerrain_(1, false, GRASS_TEXTURE),
                hillTerrain_(3, false, HILL_TEXTURE),
                riverTerrain_(2, true, RIVER_TEXTURE),        
        {}
    private:
        Terrain* tiles_[WIDTH][HEIGHT];
        Terrain grassTerrain_;
        Terrain hillTerrain_;
        Terrain riverTerrain_;
};

void World::generaterTerrain(){
    for(int x = 0; x < WIDTH; x++){
        for(int y = 0; y < HEIGHT; y++){
            if(random(10) == 0){
                tiles_[x][y] = &hillTerrain_;
            }else{
                tiles_[x][y] = &grassTerrain_;
            }
        }
    }
    int x = random(WIDTH);
    for(int y = 0; y < HEIGHT; y++){
        tiles_[x][y] = &riverTerrain_;
    }
}

const Terrain& World::getTile(int x, int y) const{
    return *tiles_[x][y];
}